package net.lucamasini.ricette.server;

import javax.servlet.ServletContext;

import com.google.gwt.requestfactory.server.RequestFactoryServlet;
import com.google.gwt.requestfactory.shared.ServiceLocator;

public class RicetteServiceLocator implements ServiceLocator {

	@Override
	public Object getInstance(Class<?> clazz) {
		return new RicetteServiceServlet(){
			private static final long serialVersionUID = 1L;

			@Override
			public ServletContext getServletContext() {
				
				return RequestFactoryServlet.getThreadLocalRequest().getSession(true).getServletContext();
			}
		};
	}

}
